package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 账单实体类
 * 
 * @author mark
 * @date 2025-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("elder_bill")
@Schema(name = "ElderBill", description = "账单表")
public class ElderBill {

    @Schema(description = "账单ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "老人ID")
    @TableField("elder_id")
    private Long elderId;

    @Schema(description = "房间id")
    @TableField("room_id")
    private Integer roomId;

    @Schema(description = "账单编号")
    @TableField("bill_number")
    private String billNumber;

    @Schema(description = "账单月份(yyyy-MM)")
    @TableField("bill_month")
    private String billMonth;

    @Schema(description = "费用类型：1-床位费，2-护理费，3-餐费，4-水电费，5-仪表类 6-其他")
    @TableField("item_type")
    private Integer itemType;

    @Schema(description = "缴费类型：1-预缴费，2-缴费")
    @TableField("bill_type")
    private Integer billType;

    @Schema(description = "是否欠费")
    @TableField("is_charge")
    private Integer isCharge;

    @Schema(description = "费用")
    @TableField("fee_amount")
    private BigDecimal feeAmount;

    @Schema(description = "账户余额")
    @TableField("account_amount")
    private BigDecimal accountAmount;

    @Schema(description = "总金额")
    @TableField("total_amount")
    private BigDecimal totalAmount;

    @Schema(description = "已付金额")
    @TableField("paid_amount")
    private BigDecimal paidAmount;

    @Schema(description = "账单日期")
    @TableField("billing_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime billingDate;

    @Schema(description = "付款截止日期")
    @TableField("due_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime dueDate;

    @Schema(description = "状态：1-未支付，2-部分支付，3-已付清，4-已取消")
    @TableField("status")
    private Integer status;

    @Schema(description = "折扣")
    @TableField("bill_discount")
    private Float billDiscount;
}
